<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统- 后台管理</title>
<link href="<%=basePath%>/css/default.css" rel="stylesheet"	type="text/css" />
<script type="text/javascript" src="<%=basePath%>/js/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/common.js"></script>
<script type="text/javascript"	src="<%=basePath%>/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
function rechargeAdd(){
	parent.openWin("<%=basePath%>/rechargeAdd.do",520, 300, '现金充值', '现金充值',
			'现金充值');
	}
function checkForm(){	
	$("#rechargeQueryForm").submit();
	return true;	
}
function goToPage(curPage){
	$("#queryPageCurPage").val(curPage);
	$("#rechargeQueryForm").submit();
}
</script>
</head>
<body>
	<table width="100%" border="0" cellspacing="6" cellpadding="0"
		style="border-collapse: separate; border-spacing: 6px;">
		<tr valign="top">
			<td>
			
				<table width="100%" border="0" cellspacing="0" cellpadding="0"
					class="blockTable">
					<tr>
						<td width="65%" style="padding: 6px 10px;" class="blockTd">
							<div style="float: left">
								<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn'
									hidefocus='true' tabindex='-1' onselectstart='return false'
									id='BtnAdd' onClick="rechargeAdd();return false;"
									priv="article_modify"> <img
									src="<%=basePath%>/images/icons/icon003a2.gif" width="20"
									height="20" /><b>新充值&nbsp;</b>
								</a> 
							</div>
						</td>
					</tr>
					<tr>				
						<td style="padding: 2px 10px;">
							<div style="float: left;"> 
							<form id="rechargeQueryForm"  name="rechargeQueryForm" action="<%=basePath%>/rechargeList.do" method="post" target="consoleFrame" >
								<input name="queryPage.curPage" id="queryPageCurPage" type="hidden" value="${queryPage.curPage}" />
								 	<font color="red">充值时间</font> 从:&nbsp;<input name="recharges.beginTime" id="beginTime" value="${recharges.beginTime}"  type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>&nbsp;
								至:&nbsp;<input name="recharges.endTime" id="endTime" value="${recharges.endTime}" type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>&nbsp;
							用户编号: 
							<input name="recharges.userId" value ="${recharges.userId}" type="text" id="recharges.userId"/> 																	
							交易单号: 
							<input name="recharges.tradeNo" value ="${recharges.tradeNo}" type="text" id="recharges.tradeNo"/>			
							<input id="Submitbutton" type="submit" value="查询" />&nbsp;&nbsp;
							</form>
							</div>
						</td>					
					</tr>
					<tr>
						<td
							style="padding-top: 2px; padding-left: 6px; padding-right: 6px; padding-bottom: 2px;">
							<table width="100%" cellpadding="2" cellspacing="0"
								class="dataTable">
								<tr class="dataTableHead">
									<td width="10%"><strong>用户编号</strong></td>
									<td width="10%"><strong>充值时间</strong></td>
									<td width="10%"><strong>交易单号</strong></td>								
									<td width="10%"><strong>充值金额(元)</strong></td>
									<td width="10%"><strong>充值状态</strong></td>
									<td width="10%"><strong>充值方式</strong></td>
								</tr>
								<c:forEach items="${rechargesList}" var="recharge">
									<tr>
										<td>${recharge.userId}</td>										
										<td><fmt:formatDate value="${recharge.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></td>								
										<td>${recharge.tradeNo}</td>
										<td>${recharge.totalFee}</td>										
										<td>${recharge.status}</td>
										<td>${recharge.payType}</td>
									</tr>
								</c:forEach>
							<tr>
							<td colspan="6" align="left">
								<div style='float:right;font-family:Tahoma'>
									<a href="javascript:goToPage('1');">第一页</a>
										&nbsp;
									<c:if test="${((queryPage.curPage) > 1)}">
									|&nbsp;<a href="javascript:goToPage('${(queryPage.curPage-1)}');">上一页</a>
									&nbsp;|
									</c:if>&nbsp;
									<c:if test="${queryPage.curPage< queryPage.pageCount}">
										<a href="javascript:goToPage('${(queryPage.curPage+1)}');">下一页</a>&nbsp;|&nbsp;<a href="javascript:goToPage('${(queryPage.pageCount)}');">最末页</a>
									</c:if>
									&nbsp;&nbsp;
									转到第&nbsp;<input id="gotopage" type='text' class='inputText' style='width:40px' onKeyUp="value=value.replace(/\D/g,'')">&nbsp;页&nbsp;&nbsp;<input type='button' onclick="if(!/^\d+$/.test($('#gotopage').val())){alert('错误的页码');$('#gotopage').focus();}else{goToPage($('#gotopage').val());}" class='inputButton' value='跳转'>
								</div>
								<div style='float:left;font-family:Tahoma'>共 ${(queryPage.totalItem)} 条记录，每页  ${(queryPage.pageSize)} 条，当前第  ${(queryPage.curPage)} / ${(queryPage.pageCount)} 页</div>
							</td>
							</tr>	
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
